#include "render_system/scene.h"

#include "render_system/gl_header.h"
#include "utility.h"

void Scene::onRender()
{
    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    glutSwapBuffers();
}


void Scene::onSizeChanged( int iWidth, int iHeight )
{
    if (0 == iHeight)
    {
        iHeight = 1;
    }

    glViewport(0, 0, iWidth, iHeight);

    _projectionMatrix = glm::perspective<glm::float_t>(
        60.0f,
        (glm::float_t)iWidth/(glm::float_t)iHeight,
        0.1f,
        100.0f);

    _viewSize.width = iWidth;
    _viewSize.height = iHeight;
}

